<link rel="stylesheet" href="<?php echo TempDefault?>css/galleriffic-2.css" type="text/css" />
<script type="text/javascript" src="<?php echo TempDefault?>js/jquery.galleriffic.js"></script>
<script type="text/javascript" src="<?php echo TempDefault?>js/jquery.opacityrollover.js"></script>
<!-- Start Advanced Gallery Html Containers -->
<div id="gallery" class="content">
	<div id="controls" class="controls"></div>
	<div class="slideshow-container">
		<div id="loading" class="loader"></div>
		<div id="slideshow" class="slideshow"></div>
	</div>
	<div id="caption" class="caption-container"></div>
</div>
<div id="thumbs" class="navigation">
	<ul class="thumbs noscript">
	<?php foreach ($this->allPhotoByLibPhoto as $allPhotoByLibPhoto):?>
		<li>
			<a class="thumb" name="leaf" href="<?php echo IMG_URL.$allPhotoByLibPhoto["IMG"]?>" title="<?php echo $allPhotoByLibPhoto["LONG_DESCRITION"]?>">
				<img src="<?php echo IMG_URL.$allPhotoByLibPhoto["IMG"]?>" alt="Title #0" width="50" height="50" />
			</a>
			<div class="caption">
				<div class="download">
					<a href="<?php echo IMG_URL.$allPhotoByLibPhoto["IMG"]?>">Download Original</a>
				</div>
				<div class="image-title"><?php echo $allPhotoByLibPhoto["SHORT_DESCRIPTION"]?></div>
				<div class="image-desc"><?php echo $allPhotoByLibPhoto["LONG_DESCRIPTION"]?></div>
			</div>
		</li>

		<?php endforeach;?>
	</ul>
</div>
<div style="clear: both;"></div>

<script type="text/javascript">
    jQuery(document).ready(function($) {
        // We only want these styles applied when javascript is enabled
        $('div.navigation').css({'width' : '300px', 'float' : 'left'});
        $('div.content').css('display', 'block');
        // Initially set opacity on thumbs and add
        // additional styling for hover effect on thumbs
        var onMouseOutOpacity = 0.67;
        $('#thumbs ul.thumbs li').opacityrollover({
            mouseOutOpacity:   onMouseOutOpacity,
            mouseOverOpacity:  1.0,
            fadeSpeed:         'fast',
            exemptionSelector: '.selected'
        });
        
        // Initialize Advanced Galleriffic Gallery
        var gallery = $('#thumbs').galleriffic({
            delay:                     2500,
            numThumbs:                 3,
            preloadAhead:              10,
            enableTopPager:            false,
            enableBottomPager:         true,
            maxPagesToShow:            4,
            imageContainerSel:         '#slideshow',
            controlsContainerSel:      '#controls',
            captionContainerSel:       '#caption',
            loadingContainerSel:       '#loading',
            renderSSControls:          true,
            renderNavControls:         true,
            playLinkText:              'Play Slideshow',
            pauseLinkText:             'Pause Slideshow',
            prevLinkText:              '&lsaquo; Previous Photo',
            nextLinkText:              'Next Photo &rsaquo;',
            nextPageLinkText:          'Next &rsaquo;',
            prevPageLinkText:          '&lsaquo; Prev',
            enableHistory:             false,
            autoStart:                 false,
            syncTransitions:           true,
            defaultTransitionDuration: 900,
            onSlideChange:             function(prevIndex, nextIndex) {
                // 'this' refers to the gallery, which is an extension of $('#thumbs')
                this.find('ul.thumbs').children()
                    .eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end()
                    .eq(nextIndex).fadeTo('fast', 1.0);
            },
            onPageTransitionOut:       function(callback) {
                this.fadeTo('fast', 0.0, callback);
            },
            onPageTransitionIn:        function() {
                this.fadeTo('fast', 1.0);
            }
        });
    });
</script>